package com.hiray.wanandroid.ui

import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.runtime.Composable
import androidx.compose.ui.unit.ExperimentalUnitApi
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.hiray.wanandroid.ui.page.MainScreen

@ExperimentalAnimationApi
@ExperimentalUnitApi
@Composable
fun AppNavigation(){
    val navController = rememberNavController()
    NavHost(navController = navController, startDestination = "main"){
        composable("h5?url={link}"){ entry->
                val url = entry.arguments?.getString("link")?:""
            Web(navController = navController, url = url)
        }
        composable("main"){
            MainScreen()
        }
    }
}